package at.fhj.antesk.steamvaluecalc.interfaces;

import java.io.IOException;
import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import java.util.Vector;

import javax.swing.JProgressBar;
import javax.swing.table.TableModel;

import at.fhj.antesk.steamvaluecalc.Account;
import at.fhj.antesk.steamvaluecalc.Game;
import at.fhj.antesk.steamvaluecalc.view.Overview;

public interface Retriever {

	/**
	 * Retrieves the prices for all games in the List<{@link Game}> and updates the progress bar.
	 * 
	 * @param gameList
	 * @param progressBar
	 * @return
	 * @throws IOException
	 */
	public List<Game> retrievePricesForGameList(List<Game> gameList, JProgressBar progressBar) throws IOException;

	/**
	 * Creates and returns an {@link Account} Object with all its games.
	 * 
	 * @param account
	 * @return
	 * @throws SQLException
	 */
	public Account createAccount(String account);

	/**
	 * Returns a map of all the properties specified in values.properties.
	 * 
	 * @return
	 */
	public Map<String, String> getConfigsMap();

	/**
	 * Returns a map of all comma separated values specified in values.properties.
	 * 
	 * @return
	 */
	public Map<String, String[]> getCsvMap();

	/**
	 * Returns a Vector of all game titles as Strings for a JList representation.
	 * 
	 * @param gameList
	 * @return
	 */
	public Vector<String> createGameListForJList(List<Game> gameList);

	public void setMainFrame(Overview mainFrame);
	
	/**
	 * Returns the table model for the price history of the specified game.
	 * 
	 * @param game
	 * @return
	 */
	public TableModel getPriceHistoryTableDataForGame(Game game);
	
	public void updateHoursInDatabase(Game game, Account account);
	
	public void updatePriceInDatabase(Game game, Account account);

}
